home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / Borland Visual dBASE Professiona v7.0 / DATA1.CAB / Sample_Include / Winnt.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-11-20  |  73.6 KB  |  1,815 lines

  1. //--------------------------------------------------------------
  2. //
  3. //  WINNT.H
  4. //
  5. //  This file contains Windows API type and constant
  6. //  declarations for calls to the Win32 API from Visual 
  7. //  dBASE. Function prototypes are in WIN32API.PRG.
  8. //
  9. //  Visual dBASE Samples Group
  10. //
  11. //  $Revision:   1.3  $
  12. //
  13. //  Portions copyright (c) 1991-1995, Microsoft Corp. 
  14. //
  15. //--------------------------------------------------------------
  16.  
  17. #include <WINDEF.H>
  18.  
  19. //
  20. //  BUILD Version: 0093 
  21. // 
  22. // Module Name:
  23. //
  24. //    winnt.h
  25. //
  26. // Abstract:
  27. //
  28. //    This module defines the 32-Bit Windows types and constants that are
  29. //    defined by NT, but exposed through the Win32 API.
  30. //
  31. //
  32.  
  33. #ifndef WINNT_H
  34. #define WINNT_H
  35.  
  36. #define ANYSIZE_ARRAY 1
  37.  
  38. #define APPLICATION_ERROR_MASK       0x20000000
  39. #define ERROR_SEVERITY_SUCCESS       0x00000000
  40. #define ERROR_SEVERITY_INFORMATIONAL 0x40000000
  41. #define ERROR_SEVERITY_WARNING       0x80000000
  42. #define ERROR_SEVERITY_ERROR         0xC0000000
  43.  
  44. #define MINCHAR     0x80
  45. #define MAXCHAR     0x7f
  46. #define MINSHORT    0x8000
  47. #define MAXSHORT    0x7fff
  48. #define MINLONG     0x80000000
  49. #define MAXLONG     0x7fffffff
  50. #define MAXBYTE     0xff
  51. #define MAXWORD     0xffff
  52. #define MAXDWORD    0xffffffff
  53.  
  54. //
  55. // Language IDs.
  56. //
  57. // The following two combinations of primary language ID and
  58. // sublanguage ID have special semantics:
  59. //
  60. //   Primary Language ID   Sublanguage ID      Result
  61. //   -------------------   ---------------     ------------------------
  62. //   LANG_NEUTRAL          SUBLANG_NEUTRAL     Language neutral
  63. //   LANG_NEUTRAL          SUBLANG_DEFAULT     User default language
  64. //   LANG_NEUTRAL          SUBLANG_SYS_DEFAULT System default language
  65. //
  66.  
  67. //
  68. // Primary language IDs.
  69. //
  70.  
  71. #define LANG_NEUTRAL                     0x00
  72.  
  73. #define LANG_ARABIC                      0x01
  74. #define LANG_AFRIKAANS                   0x36
  75. #define LANG_ALBANIAN                    0x1c
  76. #define LANG_BASQUE                      0x2d
  77. #define LANG_BULGARIAN                   0x02
  78. #define LANG_BYELORUSSIAN                0x23
  79. #define LANG_CATALAN                     0x03
  80. #define LANG_CHINESE                     0x04
  81. #define LANG_CROATIAN                    0x1a
  82. #define LANG_CZECH                       0x05
  83. #define LANG_DANISH                      0x06
  84. #define LANG_DUTCH                       0x13
  85. #define LANG_ENGLISH                     0x09
  86. #define LANG_ESTONIAN                    0x25
  87. #define LANG_FAEROESE                    0x38
  88. #define LANG_FARSI                       0x29
  89. #define LANG_FINNISH                     0x0b
  90. #define LANG_FRENCH                      0x0c
  91. #define LANG_GERMAN                      0x07
  92. #define LANG_GREEK                       0x08
  93. #define LANG_HEBREW                      0x0D
  94. #define LANG_HUNGARIAN                   0x0e
  95. #define LANG_ICELANDIC                   0x0f
  96. #define LANG_INDONESIAN                  0x21
  97. #define LANG_ITALIAN                     0x10
  98. #define LANG_JAPANESE                    0x11
  99. #define LANG_KOREAN                      0x12
  100. #define LANG_LATVIAN                     0x26
  101. #define LANG_LITHUANIAN                  0x27
  102. #define LANG_NORWEGIAN                   0x14
  103. #define LANG_POLISH                      0x15
  104. #define LANG_PORTUGUESE                  0x16
  105. #define LANG_ROMANIAN                    0x18
  106. #define LANG_RUSSIAN                     0x19
  107. #define LANG_SLOVAK                      0x1b
  108. #define LANG_SLOVENIAN                   0x24
  109. #define LANG_SORBIAN                     0x2e
  110. #define LANG_SPANISH                     0x0a
  111. #define LANG_SWEDISH                     0x1d
  112. #define LANG_THAI                        0x1e
  113. #define LANG_TURKISH                     0x1f
  114. #define LANG_UKRAINIAN                   0x22
  115.  
  116. //
  117. // Sublanguage IDs.
  118. //
  119. // The name immediately following SUBLANG_ dictates which primary
  120. // language ID that sublanguage ID can be combined with to form a
  121. // valid language ID.
  122. //
  123. #define SUBLANG_NEUTRAL                  0x00    /* language neutral */
  124. #define SUBLANG_DEFAULT                  0x01    /* user default */
  125. #define SUBLANG_SYS_DEFAULT              0x02    /* system default */
  126.  
  127. #define SUBLANG_ARABIC                   0x01    /* Arabic (Saudi Arabia) */
  128. #define SUBLANG_ARABIC_IRAQ              0x02    /* Arabic (Iraq) */
  129. #define SUBLANG_ARABIC_EGYPT             0x03    /* Arabic (Egypt) */
  130. #define SUBLANG_ARABIC_LIBYA             0x04    /* Arabic (Libya) */
  131. #define SUBLANG_ARABIC_ALGERIA           0x05    /* Arabic (Algeria) */
  132. #define SUBLANG_ARABIC_MOROCCO           0x06    /* Arabic (Morocco) */
  133. #define SUBLANG_ARABIC_TUNISIA           0x07    /* Arabic (Tunisia) */
  134. #define SUBLANG_ARABIC_OMAN              0x08    /* Arabic (Oman) */
  135. #define SUBLANG_ARABIC_YEMEN             0x09    /* Arabic (Yemen) */
  136. #define SUBLANG_ARABIC_SYRIA             0x10    /* Arabic (Syria) */
  137. #define SUBLANG_ARABIC_JORDAN            0x11    /* Arabic (Jordan) */
  138. #define SUBLANG_ARABIC_LEBANON           0x12    /* Arabic (Lebanon) */
  139. #define SUBLANG_ARABIC_KUWAIT            0x13    /* Arabic (Kuwait) */
  140. #define SUBLANG_ARABIC_UAE               0x14    /* Arabic (United Arab Emirates) */
  141. #define SUBLANG_ARABIC_BAHRAIN           0x15    /* Arabic (Bahrain) */
  142. #define SUBLANG_ARABIC_QATAR             0x16    /* Arabic (Qatar) */
  143. #define SUBLANG_CHINESE_TRADITIONAL      0x01    /* Chinese (Taiwan) */
  144. #define SUBLANG_CHINESE_SIMPLIFIED       0x02    /* Chinese (PR China) */
  145. #define SUBLANG_CHINESE_HONGKONG         0x03    /* Chinese (Hong Kong) */
  146. #define SUBLANG_CHINESE_SINGAPORE        0x04    /* Chinese (Singapore) */
  147. #define SUBLANG_DUTCH                    0x01    /* Dutch */
  148. #define SUBLANG_DUTCH_BELGIAN            0x02    /* Dutch (Belgian) */
  149. #define SUBLANG_ENGLISH_US               0x01    /* English (USA) */
  150. #define SUBLANG_ENGLISH_UK               0x02    /* English (UK) */
  151. #define SUBLANG_ENGLISH_AUS              0x03    /* English (Australian) */
  152. #define SUBLANG_ENGLISH_CAN              0x04    /* English (Canadian) */
  153. #define SUBLANG_ENGLISH_NZ               0x05    /* English (New Zealand) */
  154. #define SUBLANG_ENGLISH_EIRE             0x06    /* English (Irish) */
  155. #define SUBLANG_ENGLISH_SAFRICA          0x07    /* English (South Africa) */
  156. #define SUBLANG_ENGLISH_JAMAICA          0x08    /* English (Jamaica) */
  157. #define SUBLANG_ENGLISH_CARRIBEAN        0x09    /* English (Carribean) */
  158. #define SUBLANG_FRENCH                   0x01    /* French */
  159. #define SUBLANG_FRENCH_BELGIAN           0x02    /* French (Belgian) */
  160. #define SUBLANG_FRENCH_CANADIAN          0x03    /* French (Canadian) */
  161. #define SUBLANG_FRENCH_SWISS             0x04    /* French (Swiss) */
  162. #define SUBLANG_FRENCH_LUXEMBOURG        0x05    /* French (Luxembourg) */
  163. #define SUBLANG_GERMAN                   0x01    /* German */
  164. #define SUBLANG_GERMAN_SWISS             0x02    /* German (Swiss) */
  165. #define SUBLANG_GERMAN_AUSTRIAN          0x03    /* German (Austrian) */
  166. #define SUBLANG_GERMAN_LUXEMBOURG        0x04    /* German (Luxembourg) */
  167. #define SUBLANG_GERMAN_LIECHTENSTEIN     0x05    /* German (Liechtenstein) */
  168. #define SUBLANG_ITALIAN                  0x01    /* Italian */
  169. #define SUBLANG_ITALIAN_SWISS            0x02    /* Italian (Swiss) */
  170. #define SUBLANG_KOREAN                   0x01    /* Korean */
  171. #define SUBLANG_KOREAN_JOHAB             0x02    /* Korean (Johab) */
  172. #define SUBLANG_NORWEGIAN_BOKMAL         0x01    /* Norwegian (Bokmal) */
  173. #define SUBLANG_NORWEGIAN_NYNORSK        0x02    /* Norwegian (Nynorsk) */
  174. #define SUBLANG_PORTUGUESE               0x02    /* Portuguese */
  175. #define SUBLANG_PORTUGUESE_BRAZILIAN     0x01    /* Portuguese (Brazilian) */
  176. #define SUBLANG_SPANISH                  0x01    /* Spanish (Castilian) */
  177. #define SUBLANG_SPANISH_MEXICAN          0x02    /* Spanish (Mexican) */
  178. #define SUBLANG_SPANISH_MODERN           0x03    /* Spanish (Modern) */
  179. #define SUBLANG_SPANISH_GUATEMALA        0x04    /* Spanish (Guatemala) */
  180. #define SUBLANG_SPANISH_COSTARICA        0x05    /* Spanish (Costa Rica) */
  181. #define SUBLANG_SPANISH_PANAMA           0x06    /* Spanish (Panama) */
  182. #define SUBLANG_SPANISH_DOMINICAN        0x07    /* Spanish (Dominican Republic) */
  183. #define SUBLANG_SPANISH_VENEZUELA        0x08    /* Spanish (Venezuela) */
  184. #define SUBLANG_SPANISH_COLOMBIA         0x09    /* Spanish (Colombia) */
  185. #define SUBLANG_SPANISH_PERU             0x10    /* Spanish (Peru) */
  186. #define SUBLANG_SPANISH_ARGENTINA        0x11    /* Spanish (Argentina) */
  187. #define SUBLANG_SPANISH_ECUADOR          0x12    /* Spanish (Ecuador) */
  188. #define SUBLANG_SPANISH_CHILE            0x13    /* Spanish (Chile) */
  189. #define SUBLANG_SPANISH_URUGUAY          0x14    /* Spanish (Uruguay) */
  190. #define SUBLANG_SPANISH_PARAGUAY         0x15    /* Spanish (Paraguay) */
  191. #define SUBLANG_SPANISH_BOLIVIA          0x16    /* Spanish (Bolivia) */
  192.  
  193. //
  194. // Sorting IDs.
  195. //
  196.  
  197. #define SORT_DEFAULT                     0x0     /* sorting default */
  198.  
  199. #define SORT_JAPANESE_XJIS               0x0     /* Japanese XJIS order */
  200. #define SORT_JAPANESE_UNICODE            0x1     /* Japanese Unicode order */
  201.  
  202. #define SORT_CHINESE_BIG5                0x0     /* Chinese BIG5 order */
  203. #define SORT_CHINESE_UNICODE             0x1     /* Chinese Unicode order */
  204.  
  205. #define SORT_KOREAN_KSC                  0x0     /* Korean KSC order */
  206. #define SORT_KOREAN_UNICODE              0x1     /* Korean Unicode order */
  207.  
  208.  
  209. //
  210. // A language ID is a 16 bit value which is the combination of a
  211. // primary language ID and a secondary language ID.  The bits are
  212. // allocated as follows:
  213. //
  214. //      +-----------------------+-------------------------+
  215. //      |     Sublanguage ID    |   Primary Language ID   |
  216. //      +-----------------------+-------------------------+
  217. //       15                   10 9                       0   bit
  218. //
  219. //
  220. // Language ID creation/extraction macros:
  221. //
  222. //   MAKELANGID    - construct language id from a primary language id and
  223. //                   a sublanguage id.
  224. //   PRIMARYLANGID - extract primary language id from a language id.
  225. //   SUBLANGID     - extract sublanguage id from a language id.
  226. //
  227. #define MAKELANGID(p, s)       (bitor(bitlshift(LOWORD(s),10),LOWORD(p)))
  228. #define PRIMARYLANGID(lgid)    (bitand(LOWORD(lgid),0x3ff))
  229. #define SUBLANGID(lgid)        (bitrshift(LOWORD(lgid), 10)))
  230.  
  231.  
  232. //
  233. // A locale ID is a 32 bit value which is the combination of a
  234. // language ID, a sort ID, and a reserved area.  The bits are
  235. // allocated as follows:
  236. //
  237. //      +-------------+---------+-------------------------+
  238. //      |   Reserved  | Sort ID |      Language ID        |
  239. //      +-------------+---------+-------------------------+
  240. //       31         20 19     16 15                      0   bit
  241. //
  242. //
  243. // Locale ID creation/extraction macros:
  244. //
  245. //   MAKELCID       - construct locale id from a language id and a sort id.
  246. //   LANGIDFROMLCID - extract language id from a locale id.
  247. //   SORTIDFROMLCID - extract sort id from a locale id.
  248. //
  249.  
  250. #define NLS_VALID_LOCALE_MASK  0x000fffff
  251. #define MAKELCID(lgid, srtid)  (bitor(bitlshift(LOWORD(srtid),16),LOWORD(lgid)))
  252. #define LANGIDFROMLCID(lcid)   LOWORD(lcid)
  253. #define SORTIDFROMLCID(lcid)   LOWORD( bitrshift(bitand((lcid),NLS_VALID_LOCALE_MASK),16) )
  254.  
  255.  
  256. //
  257. // Default System and User IDs for language and locale.
  258. //
  259. #define LANG_SYSTEM_DEFAULT    (MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT))
  260. #define LANG_USER_DEFAULT      (MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT))
  261.  
  262. #define LOCALE_SYSTEM_DEFAULT  (MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT))
  263. #define LOCALE_USER_DEFAULT    (MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT))
  264.  
  265. #define STATUS_WAIT_0                    (0x00000000)
  266. #define STATUS_ABANDONED_WAIT_0          (0x00000080)
  267. #define STATUS_USER_APC                  (0x000000C0)
  268. #define STATUS_TIMEOUT                   (0x00000102)
  269. #define STATUS_PENDING                   (0x00000103)
  270. #define STATUS_SEGMENT_NOTIFICATION      (0x40000005)
  271. #define STATUS_GUARD_PAGE_VIOLATION      (0x80000001)
  272. #define STATUS_DATATYPE_MISALIGNMENT     (0x80000002)
  273. #define STATUS_BREAKPOINT                (0x80000003)
  274. #define STATUS_SINGLE_STEP               (0x80000004)
  275. #define STATUS_ACCESS_VIOLATION          (0xC0000005)
  276. #define STATUS_IN_PAGE_ERROR             (0xC0000006)
  277. #define STATUS_NO_MEMORY                 (0xC0000017)
  278. #define STATUS_ILLEGAL_INSTRUCTION       (0xC000001D)
  279. #define STATUS_NONCONTINUABLE_EXCEPTION  (0xC0000025)
  280. #define STATUS_INVALID_DISPOSITION       (0xC0000026)
  281. #define STATUS_ARRAY_BOUNDS_EXCEEDED     (0xC000008C)
  282. #define STATUS_FLOAT_DENORMAL_OPERAND    (0xC000008D)
  283. #define STATUS_FLOAT_DIVIDE_BY_ZERO      (0xC000008E)
  284. #define STATUS_FLOAT_INEXACT_RESULT      (0xC000008F)
  285. #define STATUS_FLOAT_INVALID_OPERATION   (0xC0000090)
  286. #define STATUS_FLOAT_OVERFLOW            (0xC0000091)
  287. #define STATUS_FLOAT_STACK_CHECK         (0xC0000092)
  288. #define STATUS_FLOAT_UNDERFLOW           (0xC0000093)
  289. #define STATUS_INTEGER_DIVIDE_BY_ZERO    (0xC0000094)
  290. #define STATUS_INTEGER_OVERFLOW          (0xC0000095)
  291. #define STATUS_PRIVILEGED_INSTRUCTION    (0xC0000096)
  292. #define STATUS_STACK_OVERFLOW            (0xC00000FD)
  293. #define STATUS_CONTROL_C_EXIT            (0xC000013A)
  294. #define MAXIMUM_WAIT_OBJECTS 64     // Maximum number of wait objects
  295.  
  296. #define MAXIMUM_SUSPEND_COUNT MAXCHAR // Maximum times thread can be suspended
  297.  
  298. #define KSPIN_LOCK     DWORD
  299.  
  300. #define PROCESS_TERMINATE         (0x0001)
  301. #define PROCESS_CREATE_THREAD     (0x0002)
  302. #define PROCESS_VM_OPERATION      (0x0008)
  303. #define PROCESS_VM_READ           (0x0010)
  304. #define PROCESS_VM_WRITE          (0x0020)
  305. #define PROCESS_DUP_HANDLE        (0x0040)
  306. #define PROCESS_CREATE_PROCESS    (0x0080)
  307. #define PROCESS_SET_QUOTA         (0x0100)
  308. #define PROCESS_SET_INFORMATION   (0x0200)
  309. #define PROCESS_QUERY_INFORMATION (0x0400)
  310. #define PROCESS_ALL_ACCESS        (bitor(bitor(STANDARD_RIGHTS_REQUIRED, SYNCHRONIZE), 0xFFF))
  311.  
  312. #define THREAD_TERMINATE               (0x0001)
  313. #define THREAD_SUSPEND_RESUME          (0x0002)
  314. #define THREAD_GET_CONTEXT             (0x0008)
  315. #define THREAD_SET_CONTEXT             (0x0010)
  316. #define THREAD_SET_INFORMATION         (0x0020)
  317. #define THREAD_QUERY_INFORMATION       (0x0040)
  318. #define THREAD_SET_THREAD_TOKEN        (0x0080)
  319. #define THREAD_IMPERSONATE             (0x0100)
  320. #define THREAD_DIRECT_IMPERSONATION    (0x0200)
  321.  
  322. #define THREAD_ALL_ACCESS         (bitor(bitor(STANDARD_RIGHTS_REQUIRED, SYNCHRONIZE), 0x3FF))
  323.  
  324. #define TLS_MINIMUM_AVAILABLE 64
  325. #define THREAD_BASE_PRIORITY_LOWRT  15  // value that gets a thread to LowRealtime-1
  326. #define THREAD_BASE_PRIORITY_MAX    2   // maximum thread base priority boost
  327. #define THREAD_BASE_PRIORITY_MIN    -2  // minimum thread base priority boost
  328. #define THREAD_BASE_PRIORITY_IDLE   -15 // value that gets a thread to idle
  329.  
  330. #define EVENT_MODIFY_STATE      0x0002
  331. #define EVENT_ALL_ACCESS  (bitor(bitor(STANDARD_RIGHTS_REQUIRED,SYNCHRONIZE),0x3))
  332. #define MUTANT_QUERY_STATE      0x0001
  333.  
  334. #define MUTANT_ALL_ACCESS (bitor(bitor(STANDARD_RIGHTS_REQUIRED,SYNCHRONIZE), MUTANT_QUERY_STATE)))
  335. #define SEMAPHORE_MODIFY_STATE      0x0002
  336. #define SEMAPHORE_ALL_ACCESS (bitor(bitor(STANDARD_RIGHTS_REQUIRED,SYNCHRONIZE),0x3))
  337. #define TIME_ZONE_ID_UNKNOWN  0
  338. #define TIME_ZONE_ID_STANDARD 1
  339. #define TIME_ZONE_ID_DAYLIGHT 2
  340.  
  341. #define PROCESSOR_INTEL_386     386
  342. #define PROCESSOR_INTEL_486     486
  343. #define PROCESSOR_INTEL_PENTIUM 586
  344. #define PROCESSOR_MIPS_R4000    4000
  345. #define PROCESSOR_ALPHA_21064   21064
  346.  
  347. #define PROCESSOR_ARCHITECTURE_INTEL 0
  348. #define PROCESSOR_ARCHITECTURE_MIPS  1
  349. #define PROCESSOR_ARCHITECTURE_ALPHA 2
  350. #define PROCESSOR_ARCHITECTURE_PPC   3
  351. #define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF
  352.  
  353. #define SECTION_QUERY       0x0001
  354. #define SECTION_MAP_WRITE   0x0002
  355. #define SECTION_MAP_READ    0x0004
  356. #define SECTION_MAP_EXECUTE 0x0008
  357. #define SECTION_EXTEND_SIZE 0x0010
  358.  
  359. #define SECTION_ALL_ACCESS (bitor(bitor(bitor(bitor(bitor(STANDARD_RIGHTS_REQUIRED,SECTION_QUERY), SECTION_MAP_WRITE), SECTION_MAP_READ), SECTION_MAP_EXECUTE), SECTION_EXTEND_SIZE))
  360.  
  361. #define PAGE_NOACCESS          0x01
  362. #define PAGE_READONLY          0x02
  363. #define PAGE_READWRITE         0x04
  364. #define PAGE_WRITECOPY         0x08
  365. #define PAGE_EXECUTE           0x10
  366. #define PAGE_EXECUTE_READ      0x20
  367. #define PAGE_EXECUTE_READWRITE 0x40
  368. #define PAGE_EXECUTE_WRITECOPY 0x80
  369. #define PAGE_GUARD            0x100
  370. #define PAGE_NOCACHE          0x200
  371. #define MEM_COMMIT           0x1000
  372. #define MEM_RESERVE          0x2000
  373. #define MEM_DECOMMIT         0x4000
  374. #define MEM_RELEASE          0x8000
  375. #define MEM_FREE            0x10000
  376. #define MEM_PRIVATE         0x20000
  377. #define MEM_MAPPED          0x40000
  378. #define MEM_TOP_DOWN       0x100000
  379. #define SEC_FILE           0x800000
  380. #define SEC_IMAGE         0x1000000
  381. #define SEC_RESERVE       0x4000000
  382. #define SEC_COMMIT        0x8000000
  383. #define SEC_NOCACHE      0x10000000
  384. #define MEM_IMAGE         SEC_IMAGE
  385.  
  386. //
  387. // Define access rights to files and directories
  388. //
  389.  
  390. //
  391. // The FILE_READ_DATA and FILE_WRITE_DATA constants are also defined in
  392. // devioctl.h as FILE_READ_ACCESS and FILE_WRITE_ACCESS. The values for these
  393. // constants //MUST// always be in sync.
  394. // The values are redefined in devioctl.h because they must be available to
  395. // both DOS and NT.
  396. //
  397.  
  398. #define FILE_READ_DATA            ( 0x0001 )    // file & pipe
  399. #define FILE_LIST_DIRECTORY       ( 0x0001 )    // directory
  400.  
  401. #define FILE_WRITE_DATA           ( 0x0002 )    // file & pipe
  402. #define FILE_ADD_FILE             ( 0x0002 )    // directory
  403.  
  404. #define FILE_APPEND_DATA          ( 0x0004 )    // file
  405. #define FILE_ADD_SUBDIRECTORY     ( 0x0004 )    // directory
  406. #define FILE_CREATE_PIPE_INSTANCE ( 0x0004 )    // named pipe
  407.  
  408. #define FILE_READ_EA              ( 0x0008 )    // file & directory
  409. #define FILE_READ_PROPERTIES      FILE_READ_EA
  410.  
  411. #define FILE_WRITE_EA             ( 0x0010 )    // file & directory
  412. #define FILE_WRITE_PROPERTIES     FILE_WRITE_EA
  413.  
  414. #define FILE_EXECUTE              ( 0x0020 )    // file
  415. #define FILE_TRAVERSE             ( 0x0020 )    // directory
  416.  
  417. #define FILE_DELETE_CHILD         ( 0x0040 )    // directory
  418.  
  419. #define FILE_READ_ATTRIBUTES      ( 0x0080 )    // all
  420.  
  421. #define FILE_WRITE_ATTRIBUTES     ( 0x0100 )    // all
  422.  
  423. #define FILE_ALL_ACCESS (bitor(bitor(STANDARD_RIGHTS_REQUIRED, SYNCHRONIZE), 0x1FF))
  424.  
  425. #define FILE_GENERIC_READ         (bitor(bitor(bitor(bitor(STANDARD_RIGHTS_READ, FILE_READ_DATA), FILE_READ_ATTRIBUTES), FILE_READ_EA), SYNCHRONIZE))
  426.  
  427. #define FILE_GENERIC_WRITE        (bitor(bitor(bitor(bitor(bitor(STANDARD_RIGHTS_WRITE, FILE_WRITE_DATA), FILE_WRITE_ATTRIBUTES), FILE_WRITE_EA), FILE_APPEND_DATA), SYNCHRONIZE))
  428.  
  429. #define FILE_GENERIC_EXECUTE      (bitor(bitor(bitor(STANDARD_RIGHTS_EXECUTE, FILE_READ_ATTRIBUTES), FILE_EXECUTE), SYNCHRONIZE))
  430.  
  431. #define FILE_SHARE_READ                 0x00000001
  432. #define FILE_SHARE_WRITE                0x00000002
  433. #define FILE_ATTRIBUTE_READONLY         0x00000001
  434. #define FILE_ATTRIBUTE_HIDDEN           0x00000002
  435. #define FILE_ATTRIBUTE_SYSTEM           0x00000004
  436. #define FILE_ATTRIBUTE_DIRECTORY        0x00000010
  437. #define FILE_ATTRIBUTE_ARCHIVE          0x00000020
  438. #define FILE_ATTRIBUTE_NORMAL           0x00000080
  439. #define FILE_ATTRIBUTE_TEMPORARY        0x00000100
  440. #define FILE_ATTRIBUTE_COMPRESSED       0x00000800
  441. #define FILE_NOTIFY_CHANGE_FILE_NAME    0x00000001
  442. #define FILE_NOTIFY_CHANGE_DIR_NAME     0x00000002
  443. #define FILE_NOTIFY_CHANGE_ATTRIBUTES   0x00000004
  444. #define FILE_NOTIFY_CHANGE_SIZE         0x00000008
  445. #define FILE_NOTIFY_CHANGE_LAST_WRITE   0x00000010
  446. #define FILE_NOTIFY_CHANGE_SECURITY     0x00000100
  447. #define MAILSLOT_NO_MESSAGE             (-1)
  448. #define MAILSLOT_WAIT_FOREVER           (-1)
  449. #define FILE_CASE_SENSITIVE_SEARCH      0x00000001
  450. #define FILE_CASE_PRESERVED_NAMES       0x00000002
  451. #define FILE_UNICODE_ON_DISK            0x00000004
  452. #define FILE_PERSISTENT_ACLS            0x00000008
  453. #define FILE_FILE_COMPRESSION           0x00000010
  454. #define FILE_VOLUME_IS_COMPRESSED       0x00008000
  455. #define IO_COMPLETION_MODIFY_STATE  0x0002
  456. #define IO_COMPLETION_ALL_ACCESS    (bitor(bitor(STANDARD_RIGHTS_REQUIRED,SYNCHRONIZE),0x3))
  457. #define DUPLICATE_CLOSE_SOURCE      0x00000001
  458. #define DUPLICATE_SAME_ACCESS       0x00000002
  459.  
  460. #define PACCESS_TOKEN              PVOID
  461. #define PSECURITY_DESCRIPTOR       PVOID
  462. #define PSID                       PVOID
  463. #define LPSID                      PVOID
  464.  
  465. ////////////////////////////////////////////////////////////////////////
  466. //                                                                    //
  467. //                             ACCESS MASK                            //
  468. //                                                                    //
  469. ////////////////////////////////////////////////////////////////////////
  470.  
  471. //
  472. //  Define the access mask as a longword sized structure divided up as
  473. //  follows:
  474. //
  475. //       3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  476. //       1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  477. //      +---------------+---------------+-------------------------------+
  478. //      |G|G|G|G|Res'd|A| StandardRights|         SpecificRights        |
  479. //      |R|W|E|A|     |S|               |                               |
  480. //      +-+-------------+---------------+-------------------------------+
  481. //
  482. //      typedef struct _ACCESS_MASK {
  483. //          WORD   SpecificRights;
  484. //          BYTE  StandardRights;
  485. //          BYTE  AccessSystemAcl : 1;
  486. //          BYTE  Reserved : 3;
  487. //          BYTE  GenericAll : 1;
  488. //          BYTE  GenericExecute : 1;
  489. //          BYTE  GenericWrite : 1;
  490. //          BYTE  GenericRead : 1;
  491. //      } ACCESS_MASK;
  492. //      typedef ACCESS_MASK *PACCESS_MASK;
  493. //
  494. //  but to make life simple for programmer's we'll allow them to specify
  495. //  a desired access mask by simply OR'ing together mulitple single rights
  496. //  and treat an access mask as a DWORD.  For example
  497. //
  498. //      DesiredAccess = DELETE | READ_CONTROL
  499. //
  500. //  So we'll declare ACCESS_MASK as DWORD
  501. //
  502.  
  503. #define ACCESS_MASK      DWORD
  504. #define PACCESS_MASK     PDWORD
  505.  
  506. ////////////////////////////////////////////////////////////////////////
  507. //                                                                    //
  508. //                             ACCESS TYPES                           //
  509. //                                                                    //
  510. ////////////////////////////////////////////////////////////////////////
  511.  
  512.  
  513. //
  514. //  The following are masks for the predefined standard access types
  515. //
  516. //  Visual dBASE Note:
  517. // 
  518. //  The DELETE identifier has been changed to ACCESS_DELETE because
  519. //  of the conflict with the Visual dBASE command.
  520. //
  521. #define ACCESS_DELETE                    (0x00010000)   // Was DELETE
  522. #define READ_CONTROL                     (0x00020000)
  523. #define WRITE_DAC                        (0x00040000)
  524. #define WRITE_OWNER                      (0x00080000)
  525. #define SYNCHRONIZE                      (0x00100000)
  526. #define ~SYNCHRONIZE                     (0xFFEFFFFF)   // Requires support of undocumented ~ prefix 
  527.  
  528. #define STANDARD_RIGHTS_REQUIRED         (0x000F0000)
  529.  
  530. #define STANDARD_RIGHTS_READ             (READ_CONTROL)
  531. #define STANDARD_RIGHTS_WRITE            (READ_CONTROL)
  532. #define STANDARD_RIGHTS_EXECUTE          (READ_CONTROL)
  533.  
  534. #define STANDARD_RIGHTS_ALL              (0x001F0000)
  535.  
  536. #define SPECIFIC_RIGHTS_ALL              (0x0000FFFF)
  537.  
  538. //
  539. // AccessSystemAcl access type
  540. //
  541.  
  542. #define ACCESS_SYSTEM_SECURITY           (0x01000000)
  543.  
  544. //
  545. // MaximumAllowed access type
  546. //
  547.  
  548. #define MAXIMUM_ALLOWED                  (0x02000000)
  549.  
  550. //
  551. //  These are the generic rights.
  552. //
  553.  
  554. #define GENERIC_READ                     (0x80000000)
  555. #define GENERIC_WRITE                    (0x40000000)
  556. #define GENERIC_EXECUTE                  (0x20000000)
  557. #define GENERIC_ALL                      (0x10000000)
  558.  
  559. ////////////////////////////////////////////////////////////////////////
  560. //                                                                    //
  561. //              Security Id     (SID)                                 //
  562. //                                                                    //
  563. ////////////////////////////////////////////////////////////////////////
  564. //
  565. //
  566. // Pictorially the structure of an SID is as follows:
  567. //
  568. //         1   1   1   1   1   1
  569. //         5   4   3   2   1   0   9   8   7   6   5   4   3   2   1   0
  570. //      +---------------------------------------------------------------+
  571. //      |      SubAuthorityCount        |Reserved1 (SBZ)|   Revision    |
  572. //      +---------------------------------------------------------------+
  573. //      |                   IdentifierAuthority[0]                      |
  574. //      +---------------------------------------------------------------+
  575. //      |                   IdentifierAuthority[1]                      |
  576. //      +---------------------------------------------------------------+
  577. //      |                   IdentifierAuthority[2]                      |
  578. //      +---------------------------------------------------------------+
  579. //      |                                                               |
  580. //      +- -  -  -  -  -  -  -  SubAuthority[]  -  -  -  -  -  -  -  - -+
  581. //      |                                                               |
  582. //      +---------------------------------------------------------------+
  583. //
  584. //
  585.  
  586. #define SID_REVISION                     (1)    // Current revision level
  587. #define SID_MAX_SUB_AUTHORITIES          (15)
  588. #define SID_RECOMMENDED_SUB_AUTHORITIES  (1)    // Will change to around 6
  589.                                                //in a future release.
  590.  
  591. /////////////////////////////////////////////////////////////////////////////
  592. //                                                                         //
  593. // Universal well-known SIDs                                               //
  594. //                                                                         //
  595. //     Null SID              S-1-0-0                                       //
  596. //     World                 S-1-1-0                                       //
  597. //     Local                 S-1-2-0                                       //
  598. //     Creator Owner ID      S-1-3-0                                       //
  599. //     Creator Group ID      S-1-3-1                                       //
  600. //                                                                         //
  601. //     (Non-unique IDs)      S-1-4                                         //
  602. //                                                                         //
  603. /////////////////////////////////////////////////////////////////////////////
  604.  
  605. //#define SECURITY_NULL_SID_AUTHORITY     {0,0,0,0,0,0}
  606. //#define SECURITY_WORLD_SID_AUTHORITY    {0,0,0,0,0,1}
  607. //#define SECURITY_LOCAL_SID_AUTHORITY    {0,0,0,0,0,2}
  608. //#define SECURITY_CREATOR_SID_AUTHORITY  {0,0,0,0,0,3}
  609. //#define SECURITY_NON_UNIQUE_AUTHORITY   {0,0,0,0,0,4}
  610.  
  611. #define SECURITY_NULL_RID               (0x00000000)
  612. #define SECURITY_WORLD_RID              (0x00000000)
  613. #define SECURITY_LOCAL_RID              (0x00000000)
  614.  
  615. #define SECURITY_CREATOR_OWNER_RID      (0x00000000)
  616. #define SECURITY_CREATOR_GROUP_RID      (0x00000001)
  617.  
  618.  
  619.  
  620.  
  621. /////////////////////////////////////////////////////////////////////////////
  622. //                                                                         //
  623. // NT well-known SIDs                                                      //
  624. //                                                                         //
  625. //     NT Authority          S-1-5                                         //
  626. //     Dialup                S-1-5-1                                       //
  627. //                                                                         //
  628. //     Network               S-1-5-2                                       //
  629. //     Batch                 S-1-5-3                                       //
  630. //     Interactive           S-1-5-4                                       //
  631. //     Service               S-1-5-6                                       //
  632. //     AnonymousLogon        S-1-5-7       (aka null logon session)        //
  633. //                                                                         //
  634. //     (Logon IDs)           S-1-5-5-X-Y                                   //
  635. //                                                                         //
  636. //     (NT non-unique IDs)   S-1-5-0x15-...                                //
  637. //                                                                         //
  638. //     (Built-in domain)     s-1-5-0x20                                    //
  639. //                                                                         //
  640. /////////////////////////////////////////////////////////////////////////////
  641.  
  642.  
  643. //#define SECURITY_NT_AUTHORITY           {0,0,0,0,0,5}   // ntifs
  644.  
  645. #define SECURITY_DIALUP_RID             (0x00000001)
  646. #define SECURITY_NETWORK_RID            (0x00000002)
  647. #define SECURITY_BATCH_RID              (0x00000003)
  648. #define SECURITY_INTERACTIVE_RID        (0x00000004)
  649. #define SECURITY_SERVICE_RID            (0x00000006)
  650. #define SECURITY_ANONYMOUS_LOGON_RID    (0x00000007)
  651.  
  652. #define SECURITY_LOGON_IDS_RID          (0x00000005)
  653. #define SECURITY_LOGON_IDS_RID_COUNT    (3)
  654.  
  655. #define SECURITY_LOCAL_SYSTEM_RID       (0x00000012)
  656.  
  657. #define SECURITY_NT_NON_UNIQUE          (0x00000015)
  658.  
  659. #define SECURITY_BUILTIN_DOMAIN_RID     (0x00000020)
  660.  
  661.  
  662.  
  663. /////////////////////////////////////////////////////////////////////////////
  664. //                                                                         //
  665. // well-known domain relative sub-authority values (RIDs)...               //
  666. //                                                                         //
  667. /////////////////////////////////////////////////////////////////////////////
  668.  
  669. // Well-known users ...
  670.  
  671. #define DOMAIN_USER_RID_ADMIN          (0x000001F4)
  672. #define DOMAIN_USER_RID_GUEST          (0x000001F5)
  673.  
  674.  
  675.  
  676. // well-known groups ...
  677.  
  678. #define DOMAIN_GROUP_RID_ADMINS        (0x00000200)
  679. #define DOMAIN_GROUP_RID_USERS         (0x00000201)
  680. #define DOMAIN_GROUP_RID_GUESTS        (0x00000202)
  681.  
  682.  
  683. // well-known aliases ...
  684.  
  685. #define DOMAIN_ALIAS_RID_ADMINS        (0x00000220)
  686. #define DOMAIN_ALIAS_RID_USERS         (0x00000221)
  687. #define DOMAIN_ALIAS_RID_GUESTS        (0x00000222)
  688. #define DOMAIN_ALIAS_RID_POWER_USERS   (0x00000223)
  689.  
  690. #define DOMAIN_ALIAS_RID_ACCOUNT_OPS   (0x00000224)
  691. #define DOMAIN_ALIAS_RID_SYSTEM_OPS    (0x00000225)
  692. #define DOMAIN_ALIAS_RID_PRINT_OPS     (0x00000226)
  693. #define DOMAIN_ALIAS_RID_BACKUP_OPS    (0x00000227)
  694.  
  695. #define DOMAIN_ALIAS_RID_REPLICATOR    (0x00000228)
  696.  
  697.  
  698. //
  699. // Allocate the System Luid.  The first 1000 LUIDs are reserved.
  700. // Use #999 here (0x3E7 = 999)
  701. //
  702.  
  703. //#define SYSTEM_LUID                     { 0x3E7, 0x0 }
  704.  
  705. ////////////////////////////////////////////////////////////////////////
  706. //                                                                    //
  707. //                          User and Group related SID attributes     //
  708. //                                                                    //
  709. ////////////////////////////////////////////////////////////////////////
  710.  
  711. //
  712. // Group attributes
  713. //
  714.  
  715. #define SE_GROUP_MANDATORY              (0x00000001)
  716. #define SE_GROUP_ENABLED_BY_DEFAULT     (0x00000002)
  717. #define SE_GROUP_ENABLED                (0x00000004)
  718. #define SE_GROUP_OWNER                  (0x00000008)
  719. #define SE_GROUP_LOGON_ID               (0xC0000000)
  720.  
  721.  
  722. ////////////////////////////////////////////////////////////////////////
  723. //                                                                    //
  724. //                         ACL  and  ACE                              //
  725. //                                                                    //
  726. ////////////////////////////////////////////////////////////////////////
  727.  
  728. //
  729. //  Define an ACL and the ACE format.  The structure of an ACL header
  730. //  followed by one or more ACEs.  Pictorally the structure of an ACL header
  731. //  is as follows:
  732. //
  733. //       3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  734. //       1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  735. //      +-------------------------------+---------------+---------------+
  736. //      |            AclSize            |      Sbz1     |  AclRevision  |
  737. //      +-------------------------------+---------------+---------------+
  738. //      |              Sbz2             |           AceCount            |
  739. //      +-------------------------------+-------------------------------+
  740. //
  741. //  The current AclRevision is defined to be ACL_REVISION.
  742. //
  743. //  AclSize is the size, in bytes, allocated for the ACL.  This includes
  744. //  the ACL header, ACES, and remaining free space in the buffer.
  745. //
  746. //  AceCount is the number of ACES in the ACL.
  747. //
  748.  
  749. // begin_ntddk begin_ntifs
  750. // This is the 'current' ACL revision
  751.  
  752. #define ACL_REVISION     (2)
  753.  
  754. // This is the history of ACL revisions.  Add a new one whenever
  755. // ACL_REVISION is updated
  756.  
  757. #define ACL_REVISION1   (1)
  758. #define ACL_REVISION2   (2)
  759.  
  760. //
  761. //  The structure of an ACE is a common ace header followed by ace type
  762. //  specific data.  Pictorally the structure of the common ace header is
  763. //  as follows:
  764. //
  765. //       3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  766. //       1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  767. //      +---------------+-------+-------+---------------+---------------+
  768. //      |            AceSize            |    AceFlags   |     AceType   |
  769. //      +---------------+-------+-------+---------------+---------------+
  770. //
  771. //  AceType denotes the type of the ace, there are some predefined ace
  772. //  types
  773. //
  774. //  AceSize is the size, in bytes, of ace.
  775. //
  776. //  AceFlags are the Ace flags for audit and inheritance, defined shortly.
  777.  
  778. //
  779. //  The following are the predefined ace types that go into the AceType
  780. //  field of an Ace header.
  781. //
  782.  
  783. #define ACCESS_ALLOWED_ACE_TYPE          (0x0)
  784. #define ACCESS_DENIED_ACE_TYPE           (0x1)
  785. #define SYSTEM_AUDIT_ACE_TYPE            (0x2)
  786. #define SYSTEM_ALARM_ACE_TYPE            (0x3)
  787.  
  788. //
  789. //  The following are the inherit flags that go into the AceFlags field
  790. //  of an Ace header.
  791. //
  792.  
  793. #define OBJECT_INHERIT_ACE                (0x1)
  794. #define CONTAINER_INHERIT_ACE             (0x2)
  795. #define NO_PROPAGATE_INHERIT_ACE          (0x4)
  796. #define INHERIT_ONLY_ACE                  (0x8)
  797. #define VALID_INHERIT_FLAGS               (0xF)
  798.  
  799.  
  800. //  The following are the currently defined ACE flags that go into the
  801. //  AceFlags field of an ACE header.  Each ACE type has its own set of
  802. //  AceFlags.
  803. //
  804. //  SUCCESSFUL_ACCESS_ACE_FLAG - used only with system audit and alarm ACE
  805. //  types to indicate that a message is generated for successful accesses.
  806. //
  807. //  FAILED_ACCESS_ACE_FLAG - used only with system audit and alarm ACE types
  808. //  to indicate that a message is generated for failed accesses.
  809. //
  810.  
  811. //
  812. //  SYSTEM_AUDIT and SYSTEM_ALARM AceFlags
  813. //
  814. //  These control the signaling of audit and alarms for success or failure.
  815. //
  816.  
  817. #define SUCCESSFUL_ACCESS_ACE_FLAG       (0x40)
  818. #define FAILED_ACCESS_ACE_FLAG           (0x80)
  819.  
  820.  
  821. //
  822. //  We'll define the structure of the predefined ACE types.  Pictorally
  823. //  the structure of the predefined ACE's is as follows:
  824. //
  825. //       3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  826. //       1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  827. //      +---------------+-------+-------+---------------+---------------+
  828. //      |    AceFlags   | Resd  |Inherit|    AceSize    |     AceType   |
  829. //      +---------------+-------+-------+---------------+---------------+
  830. //      |                              Mask                             |
  831. //      +---------------------------------------------------------------+
  832. //      |                                                               |
  833. //      +                                                               +
  834. //      |                                                               |
  835. //      +                              Sid                              +
  836. //      |                                                               |
  837. //      +                                                               +
  838. //      |                                                               |
  839. //      +---------------------------------------------------------------+
  840. //
  841. //  Mask is the access mask associated with the ACE.  This is either the
  842. //  access allowed, access denied, audit, or alarm mask.
  843. //
  844. //  Sid is the Sid associated with the ACE.
  845. //
  846. //
  847.  
  848. //  The following declarations are used for setting and querying information
  849. //  about and ACL.  First are the various information classes available to
  850. //  the user.
  851. //
  852.  
  853.  
  854. ////////////////////////////////////////////////////////////////////////
  855. //                                                                    //
  856. //                             SECURITY_DESCRIPTOR                    //
  857. //                                                                    //
  858. ////////////////////////////////////////////////////////////////////////
  859. //
  860. //  Define the Security Descriptor and related data types.
  861. //  This is an opaque data structure.
  862. //
  863. //
  864. // Current security descriptor revision value
  865. //
  866.  
  867. #define SECURITY_DESCRIPTOR_REVISION     (1)
  868. #define SECURITY_DESCRIPTOR_REVISION1    (1)
  869.  
  870. //
  871. // Minimum length, in bytes, needed to build a security descriptor
  872. // (NOTE: This must manually be kept consistent with the)
  873. // (sizeof(SECURITY_DESCRIPTOR)                         )
  874. //
  875.  
  876. #define SECURITY_DESCRIPTOR_MIN_LENGTH   (20)
  877.  
  878. #define SECURITY_DESCRIPTOR_CONTROL    WORD
  879. #define PSECURITY_DESCRIPTOR_CONTROL   PWORD
  880.  
  881. #define SE_OWNER_DEFAULTED               (0x0001)
  882. #define SE_GROUP_DEFAULTED               (0x0002)
  883. #define SE_DACL_PRESENT                  (0x0004)
  884. #define SE_DACL_DEFAULTED                (0x0008)
  885. #define SE_SACL_PRESENT                  (0x0010)
  886. #define SE_SACL_DEFAULTED                (0x0020)
  887. #define SE_SELF_RELATIVE                 (0x8000)
  888.  
  889. //
  890. //  Where:
  891. //
  892. //      SE_OWNER_DEFAULTED - This boolean flag, when set, indicates that the
  893. //          SID pointed to by the Owner field was provided by a
  894. //          defaulting mechanism rather than explicitly provided by the
  895. //          original provider of the security descriptor.  This may
  896. //          affect the treatment of the SID with respect to inheritence
  897. //          of an owner.
  898. //
  899. //      SE_GROUP_DEFAULTED - This boolean flag, when set, indicates that the
  900. //          SID in the Group field was provided by a defaulting mechanism
  901. //          rather than explicitly provided by the original provider of
  902. //          the security descriptor.  This may affect the treatment of
  903. //          the SID with respect to inheritence of a primary group.
  904. //
  905. //      SE_DACL_PRESENT - This boolean flag, when set, indicates that the
  906. //          security descriptor contains a discretionary ACL.  If this
  907. //          flag is set and the Dacl field of the SECURITY_DESCRIPTOR is
  908. //          null, then a null ACL is explicitly being specified.
  909. //
  910. //      SE_DACL_DEFAULTED - This boolean flag, when set, indicates that the
  911. //          ACL pointed to by the Dacl field was provided by a defaulting
  912. //          mechanism rather than explicitly provided by the original
  913. //          provider of the security descriptor.  This may affect the
  914. //          treatment of the ACL with respect to inheritence of an ACL.
  915. //          This flag is ignored if the DaclPresent flag is not set.
  916. //
  917. //      SE_SACL_PRESENT - This boolean flag, when set,  indicates that the
  918. //          security descriptor contains a system ACL pointed to by the
  919. //          Sacl field.  If this flag is set and the Sacl field of the
  920. //          SECURITY_DESCRIPTOR is null, then an empty (but present)
  921. //          ACL is being specified.
  922. //
  923. //      SE_SACL_DEFAULTED - This boolean flag, when set, indicates that the
  924. //          ACL pointed to by the Sacl field was provided by a defaulting
  925. //          mechanism rather than explicitly provided by the original
  926. //          provider of the security descriptor.  This may affect the
  927. //          treatment of the ACL with respect to inheritence of an ACL.
  928. //          This flag is ignored if the SaclPresent flag is not set.
  929. //
  930. //      SE_SELF_RELATIVE - This boolean flag, when set, indicates that the
  931. //          security descriptor is in self-relative form.  In this form,
  932. //          all fields of the security descriptor are contiguous in memory
  933. //          and all pointer fields are expressed as offsets from the
  934. //          beginning of the security descriptor.  This form is useful
  935. //          for treating security descriptors as opaque data structures
  936. //          for transmission in communication protocol or for storage on
  937. //          secondary media.
  938. //
  939. //
  940. //
  941. // Pictorially the structure of a security descriptor is as follows:
  942. //
  943. //       3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  944. //       1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  945. //      +---------------------------------------------------------------+
  946. //      |            Control            |Reserved1 (SBZ)|   Revision    |
  947. //      +---------------------------------------------------------------+
  948. //      |                            Owner                              |
  949. //      +---------------------------------------------------------------+
  950. //      |                            Group                              |
  951. //      +---------------------------------------------------------------+
  952. //      |                            Sacl                               |
  953. //      +---------------------------------------------------------------+
  954. //      |                            Dacl                               |
  955. //      +---------------------------------------------------------------+
  956. //
  957. // In general, this data structure should be treated opaquely to ensure future
  958. // compatibility.
  959. //
  960. //
  961.  
  962.  
  963.  
  964. ////////////////////////////////////////////////////////////////////////
  965. //                                                                    //
  966. //               Privilege Related Data Structures                    //
  967. //                                                                    //
  968. ////////////////////////////////////////////////////////////////////////
  969.  
  970.  
  971. //
  972. // Privilege attributes
  973. //
  974.  
  975. #define SE_PRIVILEGE_ENABLED_BY_DEFAULT (0x00000001)
  976. #define SE_PRIVILEGE_ENABLED            (0x00000002)
  977. #define SE_PRIVILEGE_USED_FOR_ACCESS    (0x80000000)
  978.  
  979. //
  980. // Privilege Set Control flags
  981. //
  982.  
  983. #define PRIVILEGE_SET_ALL_NECESSARY    (1)
  984.  
  985.  
  986. ////////////////////////////////////////////////////////////////////////
  987. //                                                                    //
  988. //               NT Defined Privileges                                //
  989. //                                                                    //
  990. ////////////////////////////////////////////////////////////////////////
  991.  
  992. #define SE_CREATE_TOKEN_NAME              ("SeCreateTokenPrivilege")
  993. #define SE_ASSIGNPRIMARYTOKEN_NAME        ("SeAssignPrimaryTokenPrivilege")
  994. #define SE_LOCK_MEMORY_NAME               ("SeLockMemoryPrivilege")
  995. #define SE_INCREASE_QUOTA_NAME            ("SeIncreaseQuotaPrivilege")
  996. #define SE_UNSOLICITED_INPUT_NAME         ("SeUnsolicitedInputPrivilege")
  997. #define SE_MACHINE_ACCOUNT_NAME           ("SeMachineAccountPrivilege")
  998. #define SE_TCB_NAME                       ("SeTcbPrivilege")
  999. #define SE_SECURITY_NAME                  ("SeSecurityPrivilege")
  1000. #define SE_TAKE_OWNERSHIP_NAME            ("SeTakeOwnershipPrivilege")
  1001. #define SE_LOAD_DRIVER_NAME               ("SeLoadDriverPrivilege")
  1002. #define SE_SYSTEM_PROFILE_NAME            ("SeSystemProfilePrivilege")
  1003. #define SE_SYSTEMTIME_NAME                ("SeSystemtimePrivilege")
  1004. #define SE_PROF_SINGLE_PROCESS_NAME       ("SeProfileSingleProcessPrivilege")
  1005. #define SE_INC_BASE_PRIORITY_NAME         ("SeIncreaseBasePriorityPrivilege")
  1006. #define SE_CREATE_PAGEFILE_NAME           ("SeCreatePagefilePrivilege")
  1007. #define SE_CREATE_PERMANENT_NAME          ("SeCreatePermanentPrivilege")
  1008. #define SE_BACKUP_NAME                    ("SeBackupPrivilege")
  1009. #define SE_RESTORE_NAME                   ("SeRestorePrivilege")
  1010. #define SE_SHUTDOWN_NAME                  ("SeShutdownPrivilege")
  1011. #define SE_DEBUG_NAME                     ("SeDebugPrivilege")
  1012. #define SE_AUDIT_NAME                     ("SeAuditPrivilege")
  1013. #define SE_SYSTEM_ENVIRONMENT_NAME        ("SeSystemEnvironmentPrivilege")
  1014. #define SE_CHANGE_NOTIFY_NAME             ("SeChangeNotifyPrivilege")
  1015. #define SE_REMOTE_SHUTDOWN_NAME           ("SeRemoteShutdownPrivilege")
  1016.  
  1017.  
  1018.  
  1019. //
  1020. // Security Tracking Mode
  1021. //
  1022.  
  1023. #define SECURITY_DYNAMIC_TRACKING      (CTRUE)
  1024. #define SECURITY_STATIC_TRACKING       (CFALSE)
  1025.  
  1026. #define SECURITY_CONTEXT_TRACKING_MODE   BOOLEAN
  1027. #define PSECURITY_CONTEXT_TRACKING_MODE  PBOOLEAN
  1028.  
  1029.  
  1030.  
  1031. ////////////////////////////////////////////////////////////////////
  1032. //                                                                //
  1033. //           Token Object Definitions                             //
  1034. //                                                                //
  1035. //                                                                //
  1036. ////////////////////////////////////////////////////////////////////
  1037.  
  1038.  
  1039. //
  1040. // Token Specific Access Rights.
  1041. //
  1042.  
  1043. #define TOKEN_ASSIGN_PRIMARY    (0x0001)
  1044. #define TOKEN_DUPLICATE         (0x0002)
  1045. #define TOKEN_IMPERSONATE       (0x0004)
  1046. #define TOKEN_QUERY             (0x0008)
  1047. #define TOKEN_QUERY_SOURCE      (0x0010)
  1048. #define TOKEN_ADJUST_PRIVILEGES (0x0020)
  1049. #define TOKEN_ADJUST_GROUPS     (0x0040)
  1050. #define TOKEN_ADJUST_DEFAULT    (0x0080)
  1051.  
  1052. #define TOKEN_ALL_ACCESS (bitor(bitor(bitor(bitor(bitor(bitor(bitor(bitor(STANDARD_RIGHTS_REQUIRED, TOKEN_ASSIGN_PRIMARY), TOKEN_DUPLICATE), TOKEN_IMPERSONATE), TOKEN_QUERY),  TOKEN_QUERY_SOURCE), TOKEN_ADJUST_PRIVILEGES), TOKEN_ADJUST_GROUPS), TOKEN_ADJUST_DEFAULT))
  1053.  
  1054.  
  1055. #define TOKEN_READ       (bitor(STANDARD_RIGHTS_READ, TOKEN_QUERY))
  1056.  
  1057.  
  1058. #define TOKEN_WRITE      (bitor(bitor(bitor(STANDARD_RIGHTS_WRITE, TOKEN_ADJUST_PRIVILEGES), TOKEN_ADJUST_GROUPS), TOKEN_ADJUST_DEFAULT))
  1059.  
  1060. #define TOKEN_EXECUTE    (STANDARD_RIGHTS_EXECUTE)
  1061.  
  1062. #define TOKEN_SOURCE_LENGTH 8
  1063.  
  1064. #define OWNER_SECURITY_INFORMATION       (0x00000001)
  1065. #define GROUP_SECURITY_INFORMATION       (0x00000002)
  1066. #define DACL_SECURITY_INFORMATION        (0x00000004)
  1067. #define SACL_SECURITY_INFORMATION        (0x00000008)
  1068.  
  1069.  
  1070. //
  1071. // Image Format
  1072. //
  1073.  
  1074. #define IMAGE_DOS_SIGNATURE                 0x5A4D      // MZ
  1075. #define IMAGE_OS2_SIGNATURE                 0x454E      // NE
  1076. #define IMAGE_OS2_SIGNATURE_LE              0x454C      // LE
  1077. #define IMAGE_VXD_SIGNATURE                 0x454C      // LE
  1078. #define IMAGE_NT_SIGNATURE                  0x00004550  // PE00
  1079.  
  1080. #define IMAGE_SIZEOF_FILE_HEADER             20
  1081.  
  1082. #define IMAGE_FILE_RELOCS_STRIPPED           0x0001  // Relocation info stripped from file.
  1083. #define IMAGE_FILE_EXECUTABLE_IMAGE          0x0002  // File is executable  (i.e. no unresolved externel references).
  1084. #define IMAGE_FILE_LINE_NUMS_STRIPPED        0x0004  // Line nunbers stripped from file.
  1085. #define IMAGE_FILE_LOCAL_SYMS_STRIPPED       0x0008  // Local symbols stripped from file.
  1086. #define IMAGE_FILE_BYTES_REVERSED_LO         0x0080  // Bytes of machine word are reversed.
  1087. #define IMAGE_FILE_32BIT_MACHINE             0x0100  // 32 bit word machine.
  1088. #define IMAGE_FILE_DEBUG_STRIPPED            0x0200  // Debugging info stripped from file in .DBG file
  1089. #define IMAGE_FILE_SYSTEM                    0x1000  // System File.
  1090. #define IMAGE_FILE_DLL                       0x2000  // File is a DLL.
  1091. #define IMAGE_FILE_BYTES_REVERSED_HI         0x8000  // Bytes of machine word are reversed.
  1092.  
  1093. #define IMAGE_FILE_MACHINE_UNKNOWN           0
  1094. #define IMAGE_FILE_MACHINE_I386              0x14c   // Intel 386.
  1095. #define IMAGE_FILE_MACHINE_R3000             0x162   // MIPS little-endian, 0x160 big-endian
  1096. #define IMAGE_FILE_MACHINE_R4000             0x166   // MIPS little-endian
  1097. #define IMAGE_FILE_MACHINE_R10000            0x168   // MIPS little-endian
  1098. #define IMAGE_FILE_MACHINE_ALPHA             0x184   // Alpha_AXP
  1099. #define IMAGE_FILE_MACHINE_POWERPC           0x1F0   // IBM PowerPC Little-Endian
  1100.  
  1101. //
  1102. // Directory format.
  1103. //
  1104.  
  1105. #define IMAGE_NUMBEROF_DIRECTORY_ENTRIES    16
  1106.  
  1107.  
  1108. #define IMAGE_SIZEOF_ROM_OPTIONAL_HEADER      56
  1109. #define IMAGE_SIZEOF_STD_OPTIONAL_HEADER      28
  1110. #define IMAGE_SIZEOF_NT_OPTIONAL_HEADER      224
  1111.  
  1112. #define IMAGE_NT_OPTIONAL_HDR_MAGIC        0x10b
  1113. #define IMAGE_ROM_OPTIONAL_HDR_MAGIC       0x107
  1114.  
  1115. // Subsystem Values
  1116.  
  1117. #define IMAGE_SUBSYSTEM_UNKNOWN              0   // Unknown subsystem.
  1118. #define IMAGE_SUBSYSTEM_NATIVE               1   // Image doesn't require a subsystem.
  1119. #define IMAGE_SUBSYSTEM_WINDOWS_GUI          2   // Image runs in the Windows GUI subsystem.
  1120. #define IMAGE_SUBSYSTEM_WINDOWS_CUI          3   // Image runs in the Windows character subsystem.
  1121. #define IMAGE_SUBSYSTEM_OS2_CUI              5   // image runs in the OS/2 character subsystem.
  1122. #define IMAGE_SUBSYSTEM_POSIX_CUI            7   // image run  in the Posix character subsystem.
  1123.  
  1124.  
  1125. // Directory Entries
  1126.  
  1127. #define IMAGE_DIRECTORY_ENTRY_EXPORT         0   // Export Directory
  1128. #define IMAGE_DIRECTORY_ENTRY_IMPORT         1   // Import Directory
  1129. #define IMAGE_DIRECTORY_ENTRY_RESOURCE       2   // Resource Directory
  1130. #define IMAGE_DIRECTORY_ENTRY_EXCEPTION      3   // Exception Directory
  1131. #define IMAGE_DIRECTORY_ENTRY_SECURITY       4   // Security Directory
  1132. #define IMAGE_DIRECTORY_ENTRY_BASERELOC      5   // Base Relocation Table
  1133. #define IMAGE_DIRECTORY_ENTRY_DEBUG          6   // Debug Directory
  1134. #define IMAGE_DIRECTORY_ENTRY_COPYRIGHT      7   // Description String
  1135. #define IMAGE_DIRECTORY_ENTRY_GLOBALPTR      8   // Machine Value (MIPS GP)
  1136. #define IMAGE_DIRECTORY_ENTRY_TLS            9   // TLS Directory
  1137. #define IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG   10   // Load Configuration Directory
  1138. #define IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT  11   // Bound Import Directory in headers
  1139. #define IMAGE_DIRECTORY_ENTRY_IAT           12   // Import Address Table
  1140.  
  1141. //
  1142. // Section header format.
  1143. //
  1144.  
  1145. #define IMAGE_SIZEOF_SHORT_NAME              8
  1146.  
  1147. #define IMAGE_SIZEOF_SECTION_HEADER          40
  1148.  
  1149. //
  1150. // Section characteristics.
  1151. //
  1152.  
  1153. //      IMAGE_SCN_TYPE_REG                   0x00000000  // Reserved.
  1154. //      IMAGE_SCN_TYPE_DSECT                 0x00000001  // Reserved.
  1155. //      IMAGE_SCN_TYPE_NOLOAD                0x00000002  // Reserved.
  1156. //      IMAGE_SCN_TYPE_GROUP                 0x00000004  // Reserved.
  1157. #define IMAGE_SCN_TYPE_NO_PAD                0x00000008  // Reserved.
  1158. //      IMAGE_SCN_TYPE_COPY                  0x00000010  // Reserved.
  1159.  
  1160. #define IMAGE_SCN_CNT_CODE                   0x00000020  // Section contains code.
  1161. #define IMAGE_SCN_CNT_INITIALIZED_DATA       0x00000040  // Section contains initialized data.
  1162. #define IMAGE_SCN_CNT_UNINITIALIZED_DATA     0x00000080  // Section contains uninitialized data.
  1163.  
  1164. #define IMAGE_SCN_LNK_OTHER                  0x00000100  // Reserved.
  1165. #define IMAGE_SCN_LNK_INFO                   0x00000200  // Section contains comments or some other type of information.
  1166. //      IMAGE_SCN_TYPE_OVER                  0x00000400  // Reserved.
  1167. #define IMAGE_SCN_LNK_REMOVE                 0x00000800  // Section contents will not become part of image.
  1168. #define IMAGE_SCN_LNK_COMDAT                 0x00001000  // Section contents comdat.
  1169. //                                           0x00002000  // Reserved.
  1170.  
  1171. //      IMAGE_SCN_MEM_PROTECTED - Obsolete   0x00004000
  1172. #define IMAGE_SCN_MEM_FARDATA                0x00008000
  1173. //      IMAGE_SCN_MEM_SYSHEAP  - Obsolete    0x00010000
  1174. #define IMAGE_SCN_MEM_PURGEABLE              0x00020000
  1175. #define IMAGE_SCN_MEM_16BIT                  0x00020000
  1176. #define IMAGE_SCN_MEM_LOCKED                 0x00040000
  1177. #define IMAGE_SCN_MEM_PRELOAD                0x00080000
  1178.  
  1179. #define IMAGE_SCN_ALIGN_1BYTES               0x00100000  //
  1180. #define IMAGE_SCN_ALIGN_2BYTES               0x00200000  //
  1181. #define IMAGE_SCN_ALIGN_4BYTES               0x00300000  //
  1182. #define IMAGE_SCN_ALIGN_8BYTES               0x00400000  //
  1183. #define IMAGE_SCN_ALIGN_16BYTES              0x00500000  // Default alignment if no others are specified.
  1184. #define IMAGE_SCN_ALIGN_32BYTES              0x00600000  //
  1185. #define IMAGE_SCN_ALIGN_64BYTES              0x00700000  //
  1186. // Unused                                    0x00800000
  1187.  
  1188. #define IMAGE_SCN_LNK_NRELOC_OVFL            0x01000000  // Section contains extended relocations.
  1189. #define IMAGE_SCN_MEM_DISCARDABLE            0x02000000  // Section can be discarded.
  1190. #define IMAGE_SCN_MEM_NOT_CACHED             0x04000000  // Section is not cachable.
  1191. #define IMAGE_SCN_MEM_NOT_PAGED              0x08000000  // Section is not pageable.
  1192. #define IMAGE_SCN_MEM_SHARED                 0x10000000  // Section is shareable.
  1193. #define IMAGE_SCN_MEM_EXECUTE                0x20000000  // Section is executable.
  1194. #define IMAGE_SCN_MEM_READ                   0x40000000  // Section is readable.
  1195. #define IMAGE_SCN_MEM_WRITE                  0x80000000  // Section is writeable.
  1196.  
  1197. #define IMAGE_SIZEOF_SYMBOL                  18
  1198.  
  1199. //
  1200. // Section values.
  1201. //
  1202. // Symbols have a section number of the section in which they are
  1203. // defined. Otherwise, section numbers have the following meanings:
  1204. //
  1205.  
  1206. #define IMAGE_SYM_UNDEFINED           0          // Symbol is undefined or is common.
  1207. #define IMAGE_SYM_ABSOLUTE            -1         // Symbol is an absolute value.
  1208. #define IMAGE_SYM_DEBUG               -2         // Symbol is a special debug item.
  1209.  
  1210. //
  1211. // Type (fundamental) values.
  1212. //
  1213.  
  1214. #define IMAGE_SYM_TYPE_NULL                 0x0000  // no type.
  1215. #define IMAGE_SYM_TYPE_VOID                 0x0001  //
  1216. #define IMAGE_SYM_TYPE_CHAR                 0x0002  // type character.
  1217. #define IMAGE_SYM_TYPE_SHORT                0x0003  // type short integer.
  1218. #define IMAGE_SYM_TYPE_INT                  0x0004  //
  1219. #define IMAGE_SYM_TYPE_LONG                 0x0005  //
  1220. #define IMAGE_SYM_TYPE_FLOAT                0x0006  //
  1221. #define IMAGE_SYM_TYPE_DOUBLE               0x0007  //
  1222. #define IMAGE_SYM_TYPE_STRUCT               0x0008  //
  1223. #define IMAGE_SYM_TYPE_UNION                0x0009  //
  1224. #define IMAGE_SYM_TYPE_ENUM                 0x000A  // enumeration.
  1225. #define IMAGE_SYM_TYPE_MOE                  0x000B  // member of enumeration.
  1226. #define IMAGE_SYM_TYPE_BYTE                 0x000C  //
  1227. #define IMAGE_SYM_TYPE_WORD                 0x000D  //
  1228. #define IMAGE_SYM_TYPE_UINT                 0x000E  //
  1229. #define IMAGE_SYM_TYPE_DWORD                0x000F  //
  1230. #define IMAGE_SYM_TYPE_PCODE                0x8000  //
  1231.  
  1232. //
  1233. // Type (derived) values.
  1234. //
  1235.  
  1236. #define IMAGE_SYM_DTYPE_NULL                0       // no derived type.
  1237. #define IMAGE_SYM_DTYPE_POINTER             1       // pointer.
  1238. #define IMAGE_SYM_DTYPE_FUNCTION            2       // function.
  1239. #define IMAGE_SYM_DTYPE_ARRAY               3       // array.
  1240.  
  1241. //
  1242. // Storage classes.
  1243. //
  1244.  
  1245. #define IMAGE_SYM_CLASS_END_OF_FUNCTION     -1
  1246. #define IMAGE_SYM_CLASS_NULL                0x0000
  1247. #define IMAGE_SYM_CLASS_AUTOMATIC           0x0001
  1248. #define IMAGE_SYM_CLASS_EXTERNAL            0x0002
  1249. #define IMAGE_SYM_CLASS_STATIC              0x0003
  1250. #define IMAGE_SYM_CLASS_REGISTER            0x0004
  1251. #define IMAGE_SYM_CLASS_EXTERNAL_DEF        0x0005
  1252. #define IMAGE_SYM_CLASS_LABEL               0x0006
  1253. #define IMAGE_SYM_CLASS_UNDEFINED_LABEL     0x0007
  1254. #define IMAGE_SYM_CLASS_MEMBER_OF_STRUCT    0x0008
  1255. #define IMAGE_SYM_CLASS_ARGUMENT            0x0009
  1256. #define IMAGE_SYM_CLASS_STRUCT_TAG          0x000A
  1257. #define IMAGE_SYM_CLASS_MEMBER_OF_UNION     0x000B
  1258. #define IMAGE_SYM_CLASS_UNION_TAG           0x000C
  1259. #define IMAGE_SYM_CLASS_TYPE_DEFINITION     0x000D
  1260. #define IMAGE_SYM_CLASS_UNDEFINED_STATIC    0x000E
  1261. #define IMAGE_SYM_CLASS_ENUM_TAG            0x000F
  1262. #define IMAGE_SYM_CLASS_MEMBER_OF_ENUM      0x0010
  1263. #define IMAGE_SYM_CLASS_REGISTER_PARAM      0x0011
  1264. #define IMAGE_SYM_CLASS_BIT_FIELD           0x0012
  1265.  
  1266. #define IMAGE_SYM_CLASS_FAR_EXTERNAL        0x0044  //
  1267.  
  1268. #define IMAGE_SYM_CLASS_BLOCK               0x0064
  1269. #define IMAGE_SYM_CLASS_FUNCTION            0x0065
  1270. #define IMAGE_SYM_CLASS_END_OF_STRUCT       0x0066
  1271. #define IMAGE_SYM_CLASS_FILE                0x0067
  1272. // new
  1273. #define IMAGE_SYM_CLASS_SECTION             0x0068
  1274. #define IMAGE_SYM_CLASS_WEAK_EXTERNAL       0x0069
  1275.  
  1276. // type packing constants
  1277.  
  1278. #define N_BTMASK                            0x000F
  1279. #define N_TMASK                             0x0030
  1280. #define N_TMASK1                            0x00C0
  1281. #define N_TMASK2                            0x00F0
  1282. #define N_BTSHFT                            4
  1283. #define N_TSHIFT                            2
  1284.  
  1285. // MACROS
  1286.  
  1287. // Basic Type of  x
  1288. #define BTYPE(x) (bitand( (x), N_BTMASK ))
  1289.  
  1290. // Is x a pointer?
  1291. #ifndef ISPTR
  1292. #define ISPTR(x)   ( bitand( (x), N_TMASK ) == bitlshift(IMAGE_SYM_DTYPE_POINTER, N_BTSHFT) )
  1293. #endif
  1294.  
  1295. // Is x a function?
  1296. #ifndef ISFCN
  1297. #define ISFCN(x)  ( bitand( (x), N_TMASK ) == bitlshift(IMAGE_SYM_DTYPE_FUNCTION, N_BTSHFT) )
  1298. #endif
  1299.  
  1300. // Is x an array?
  1301.  
  1302. #ifndef ISARY
  1303. #define ISARY(x) ( bitand( (x), N_TMASK ) == bitlshift(IMAGE_SYM_DTYPE_ARRAY, N_BTSHFT) )
  1304. #endif
  1305.  
  1306. // Is x a structure, union, or enumeration TAG?
  1307. #ifndef ISTAG
  1308. #define ISTAG(x)  ((x)==IMAGE_SYM_CLASS_STRUCT_TAG .or. (x)==IMAGE_SYM_CLASS_UNION_TAG .or. (x)==IMAGE_SYM_CLASS_ENUM_TAG)
  1309. #endif
  1310.  
  1311. #define IMAGE_SIZEOF_AUX_SYMBOL             18
  1312.  
  1313. //
  1314. // Communal selection types.
  1315. //
  1316.  
  1317. #define IMAGE_COMDAT_SELECT_NODUPLICATES    1
  1318. #define IMAGE_COMDAT_SELECT_ANY             2
  1319. #define IMAGE_COMDAT_SELECT_SAME_SIZE       3
  1320. #define IMAGE_COMDAT_SELECT_EXACT_MATCH     4
  1321. #define IMAGE_COMDAT_SELECT_ASSOCIATIVE     5
  1322. #define IMAGE_COMDAT_SELECT_LARGEST         6
  1323. #define IMAGE_COMDAT_SELECT_NEWEST          7
  1324.  
  1325. #define IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY  1
  1326. #define IMAGE_WEAK_EXTERN_SEARCH_LIBRARY    2
  1327. #define IMAGE_WEAK_EXTERN_SEARCH_ALIAS      3
  1328.  
  1329. #define IMAGE_SIZEOF_RELOCATION         10
  1330.  
  1331. //
  1332. // I386 relocation types.
  1333. //
  1334.  
  1335. #define IMAGE_REL_I386_ABSOLUTE         0x0000  // Reference is absolute, no relocation is necessary
  1336. #define IMAGE_REL_I386_DIR16            0x0001  // Direct 16-bit reference to the symbols virtual address
  1337. #define IMAGE_REL_I386_REL16            0x0002  // PC-relative 16-bit reference to the symbols virtual address
  1338. #define IMAGE_REL_I386_DIR32            0x0006  // Direct 32-bit reference to the symbols virtual address
  1339. #define IMAGE_REL_I386_DIR32NB          0x0007  // Direct 32-bit reference to the symbols virtual address, base not included
  1340. #define IMAGE_REL_I386_SEG12            0x0009  // Direct 16-bit reference to the segment-selector bits of a 32-bit virtual address
  1341. #define IMAGE_REL_I386_SECTION          0x000A
  1342. #define IMAGE_REL_I386_SECREL           0x000B
  1343. #define IMAGE_REL_I386_REL32            0x0014  // PC-relative 32-bit reference to the symbols virtual address
  1344.  
  1345. #define IMAGE_SIZEOF_BASE_RELOCATION         8
  1346.  
  1347. //
  1348. // Based relocation types.
  1349. //
  1350.  
  1351. #define IMAGE_REL_BASED_ABSOLUTE              0
  1352. #define IMAGE_REL_BASED_HIGH                  1
  1353. #define IMAGE_REL_BASED_LOW                   2
  1354. #define IMAGE_REL_BASED_HIGHLOW               3
  1355. #define IMAGE_REL_BASED_HIGHADJ               4
  1356. #define IMAGE_REL_BASED_MIPS_JMPADDR          5
  1357.  
  1358. //
  1359. // Line number format.
  1360. //
  1361. #define IMAGE_SIZEOF_LINENUMBER              6
  1362.  
  1363. //
  1364. // Archive format.
  1365. //
  1366.  
  1367. #define IMAGE_ARCHIVE_START_SIZE             8
  1368. #define IMAGE_ARCHIVE_START                  "!<arch>\n"
  1369. #define IMAGE_ARCHIVE_END                    "`\n"
  1370. #define IMAGE_ARCHIVE_PAD                    "\n"
  1371. #define IMAGE_ARCHIVE_LINKER_MEMBER          "/               "
  1372. #define IMAGE_ARCHIVE_LONGNAMES_MEMBER       ("&"+"&              ")
  1373.  
  1374. #define IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR      60
  1375.  
  1376. //
  1377. // DLL support.
  1378. //
  1379.  
  1380. #define IMAGE_ORDINAL_FLAG             0x80000000
  1381. #define IMAGE_SNAP_BY_ORDINAL(Ordinal) (bitand((Ordinal), IMAGE_ORDINAL_FLAG) <> 0)
  1382. #define IMAGE_ORDINAL(Ordinal)         (bitand((Ordinal), 0xffff))
  1383.  
  1384.  
  1385. //
  1386. // Resource Format.
  1387. //
  1388.  
  1389. #define IMAGE_RESOURCE_NAME_IS_STRING        0x80000000
  1390. #define IMAGE_RESOURCE_DATA_IS_DIRECTORY     0x80000000
  1391.  
  1392. #define IMAGE_DEBUG_TYPE_UNKNOWN          0
  1393. #define IMAGE_DEBUG_TYPE_COFF             1
  1394. #define IMAGE_DEBUG_TYPE_CODEVIEW         2
  1395. #define IMAGE_DEBUG_TYPE_FPO              3
  1396. #define IMAGE_DEBUG_TYPE_MISC             4
  1397. #define IMAGE_DEBUG_TYPE_EXCEPTION        5
  1398. #define IMAGE_DEBUG_TYPE_FIXUP            6
  1399. #define IMAGE_DEBUG_TYPE_OMAP_TO_SRC      7
  1400. #define IMAGE_DEBUG_TYPE_OMAP_FROM_SRC    8
  1401.  
  1402. #define FRAME_FPO       0
  1403. #define FRAME_TRAP      1
  1404. #define FRAME_TSS       2
  1405. #define FRAME_NONFPO    3
  1406.  
  1407.  
  1408. #define IMAGE_DEBUG_MISC_EXENAME    1
  1409.  
  1410. #define IMAGE_SEPARATE_DEBUG_SIGNATURE 0x4944
  1411. //
  1412. // End Image Format
  1413. //
  1414.  
  1415. //
  1416. // for move macros
  1417. //
  1418. #define HEAP_NO_SERIALIZE               0x00000001
  1419. #define HEAP_GROWABLE                   0x00000002
  1420. #define HEAP_GENERATE_EXCEPTIONS        0x00000004
  1421. #define HEAP_ZERO_MEMORY                0x00000008
  1422. #define HEAP_REALLOC_IN_PLACE_ONLY      0x00000010
  1423. #define HEAP_TAIL_CHECKING_ENABLED      0x00000020
  1424. #define HEAP_FREE_CHECKING_ENABLED      0x00000040
  1425. #define HEAP_DISABLE_COALESCE_ON_FREE   0x00000080
  1426. #define HEAP_CREATE_ALIGN_16            0x00010000
  1427. #define HEAP_CREATE_ENABLE_TRACING      0x00020000
  1428. #define HEAP_MAXIMUM_TAG                0x0FFF
  1429. #define HEAP_PSEUDO_TAG_FLAG            0x8000
  1430. #define HEAP_TAG_SHIFT                  16
  1431. #define HEAP_MAKE_TAG_FLAGS( b, o )     ( (b) + (bitlshift((o), 16)) )
  1432.  
  1433. #define IS_TEXT_UNICODE_ASCII16               0x0001
  1434. #define IS_TEXT_UNICODE_REVERSE_ASCII16       0x0010
  1435.  
  1436. #define IS_TEXT_UNICODE_STATISTICS            0x0002
  1437. #define IS_TEXT_UNICODE_REVERSE_STATISTICS    0x0020
  1438.  
  1439. #define IS_TEXT_UNICODE_CONTROLS              0x0004
  1440. #define IS_TEXT_UNICODE_REVERSE_CONTROLS      0x0040
  1441.  
  1442. #define IS_TEXT_UNICODE_SIGNATURE             0x0008
  1443. #define IS_TEXT_UNICODE_REVERSE_SIGNATURE     0x0080
  1444.  
  1445. #define IS_TEXT_UNICODE_ILLEGAL_CHARS         0x0100
  1446. #define IS_TEXT_UNICODE_ODD_LENGTH            0x0200
  1447. #define IS_TEXT_UNICODE_DBCS_LEADBYTE         0x0400
  1448. #define IS_TEXT_UNICODE_NULL_BYTES            0x1000
  1449.  
  1450. #define IS_TEXT_UNICODE_UNICODE_MASK          0x000F
  1451. #define IS_TEXT_UNICODE_REVERSE_MASK          0x00F0
  1452. #define IS_TEXT_UNICODE_NOT_UNICODE_MASK      0x0F00
  1453. #define IS_TEXT_UNICODE_NOT_ASCII_MASK        0xF000
  1454.  
  1455. #define COMPRESSION_FORMAT_NONE          (0x0000)
  1456. #define COMPRESSION_FORMAT_DEFAULT       (0x0001)
  1457. #define COMPRESSION_FORMAT_LZNT1         (0x0002)
  1458. #define COMPRESSION_ENGINE_STANDARD      (0x0000)
  1459. #define COMPRESSION_ENGINE_MAXIMUM       (0x0100)
  1460.  
  1461. #define MESSAGE_RESOURCE_UNICODE 0x0001
  1462.  
  1463. #define RTL_CRITSECT_TYPE 0
  1464. #define RTL_RESOURCE_TYPE 1
  1465.  
  1466. #define DLL_PROCESS_ATTACH 1
  1467. #define DLL_THREAD_ATTACH  2
  1468. #define DLL_THREAD_DETACH  3
  1469. #define DLL_PROCESS_DETACH 0
  1470.  
  1471. //
  1472. // Defines for the READ flags for Eventlogging
  1473. //
  1474. #define EVENTLOG_SEQUENTIAL_READ        0x0001
  1475. #define EVENTLOG_SEEK_READ              0x0002
  1476. #define EVENTLOG_FORWARDS_READ          0x0004
  1477. #define EVENTLOG_BACKWARDS_READ         0x0008
  1478.  
  1479. //
  1480. // The types of events that can be logged.
  1481. //
  1482. #define EVENTLOG_SUCCESS                0x0000
  1483. #define EVENTLOG_ERROR_TYPE             0x0001
  1484. #define EVENTLOG_WARNING_TYPE           0x0002
  1485. #define EVENTLOG_INFORMATION_TYPE       0x0004
  1486. #define EVENTLOG_AUDIT_SUCCESS          0x0008
  1487. #define EVENTLOG_AUDIT_FAILURE          0x0010
  1488.  
  1489. //
  1490. // Defines for the WRITE flags used by Auditing for paired events
  1491. // These are not implemented in Product 1
  1492. //
  1493.  
  1494. #define EVENTLOG_START_PAIRED_EVENT    0x0001
  1495. #define EVENTLOG_END_PAIRED_EVENT      0x0002
  1496. #define EVENTLOG_END_ALL_PAIRED_EVENTS 0x0004
  1497. #define EVENTLOG_PAIRED_EVENT_ACTIVE   0x0008
  1498. #define EVENTLOG_PAIRED_EVENT_INACTIVE 0x0010
  1499.  
  1500.  
  1501. #define DBG_CONTINUE                    (0x00010002)
  1502. #define DBG_TERMINATE_THREAD            (0x40010003)
  1503. #define DBG_TERMINATE_PROCESS           (0x40010004)
  1504. #define DBG_CONTROL_C                   (0x40010005)
  1505. #define DBG_CONTROL_BREAK               (0x40010008)
  1506. #define DBG_EXCEPTION_NOT_HANDLED       (0x80010001)
  1507. //
  1508.  
  1509. //
  1510. // Registry Specific Access Rights.
  1511. //
  1512.  
  1513. #define KEY_QUERY_VALUE         (0x0001)
  1514. #define KEY_SET_VALUE           (0x0002)
  1515. #define KEY_CREATE_SUB_KEY      (0x0004)
  1516. #define KEY_ENUMERATE_SUB_KEYS  (0x0008)
  1517. #define KEY_NOTIFY              (0x0010)
  1518. #define KEY_CREATE_LINK         (0x0020)
  1519.  
  1520. #define KEY_READ                (bitand(bitor(bitor(bitor(STANDARD_RIGHTS_READ, KEY_QUERY_VALUE), KEY_ENUMERATE_SUB_KEYS), KEY_NOTIFY), ~SYNCHRONIZE))
  1521.  
  1522. #define KEY_WRITE               (bitand(bitor(bitor(STANDARD_RIGHTS_WRITE, KEY_SET_VALUE), KEY_CREATE_SUB_KEY), ~SYNCHRONIZE))
  1523.  
  1524. #define KEY_EXECUTE             (bitand(KEY_READ, ~SYNCHRONIZE))
  1525.  
  1526. #define KEY_ALL_ACCESS          (bitand(bitor(bitor(bitor(bitor(bitor(bitor(STANDARD_RIGHTS_ALL, KEY_QUERY_VALUE), KEY_SET_VALUE), KEY_CREATE_SUB_KEY), KEY_ENUMERATE_SUB_KEYS), KEY_NOTIFY), KEY_CREATE_LINK), ~SYNCHRONIZE))
  1527.  
  1528. //
  1529. // Open/Create Options
  1530. //
  1531.  
  1532. #define REG_OPTION_RESERVED         (0x00000000)   // Parameter is reserved
  1533.  
  1534. #define REG_OPTION_NON_VOLATILE     (0x00000000)   // Key is preserved
  1535.                                                    // when system is rebooted
  1536.  
  1537. #define REG_OPTION_VOLATILE         (0x00000001)   // Key is not preserved
  1538.                                                    // when system is rebooted
  1539.  
  1540. #define REG_OPTION_CREATE_LINK      (0x00000002)   // Created key is a
  1541.                                                    // symbolic link
  1542.  
  1543. #define REG_OPTION_BACKUP_RESTORE   (0x00000004)   // open for backup or restore
  1544.                                                    // special access rules
  1545.                                                    // privilege required
  1546.  
  1547. #define REG_LEGAL_OPTION            (bitor(bitor(bitor(bitor(REG_OPTION_RESERVED, REG_OPTION_NON_VOLATILE), REG_OPTION_VOLATILE), REG_OPTION_CREATE_LINK), REG_OPTION_BACKUP_RESTORE))
  1548.  
  1549. //
  1550. // Key creation/open disposition
  1551. //
  1552.  
  1553. #define REG_CREATED_NEW_KEY         (0x00000001)   // New Registry Key created
  1554. #define REG_OPENED_EXISTING_KEY     (0x00000002)   // Existing Key opened
  1555.  
  1556. //
  1557. // Key restore flags
  1558. //
  1559.  
  1560. #define REG_WHOLE_HIVE_VOLATILE     (0x00000001)   // Restore whole hive volatile
  1561. #define REG_REFRESH_HIVE            (0x00000002)   // Unwind changes to last flush
  1562.  
  1563.  
  1564. //
  1565. // Notify filter values
  1566. //
  1567. #define REG_NOTIFY_CHANGE_NAME          (0x00000001) // Create or delete (child)
  1568. #define REG_NOTIFY_CHANGE_ATTRIBUTES    (0x00000002)
  1569. #define REG_NOTIFY_CHANGE_LAST_SET      (0x00000004) // time stamp
  1570. #define REG_NOTIFY_CHANGE_SECURITY      (0x00000008)
  1571.  
  1572. #define REG_LEGAL_CHANGE_FILTER         (bitor(bitor(bitor(REG_NOTIFY_CHANGE_NAME, REG_NOTIFY_CHANGE_ATTRIBUTES, REG_NOTIFY_CHANGE_LAST_SET, REG_NOTIFY_CHANGE_SECURITY))
  1573.  
  1574. //
  1575. //
  1576. // Predefined Value Types.
  1577. //
  1578.  
  1579. #define REG_NONE                    ( 0 )   // No value type
  1580. #define REG_SZ                      ( 1 )   // Unicode nul terminated string
  1581. #define REG_EXPAND_SZ               ( 2 )   // Unicode nul terminated string
  1582.                                             // (with environment variable references)
  1583. #define REG_BINARY                  ( 3 )   // Free form binary
  1584. #define REG_DWORD                   ( 4 )   // 32-bit number
  1585. #define REG_DWORD_LITTLE_ENDIAN     ( 4 )   // 32-bit number (same as REG_DWORD)
  1586. #define REG_DWORD_BIG_ENDIAN        ( 5 )   // 32-bit number
  1587. #define REG_LINK                    ( 6 )   // Symbolic Link (unicode)
  1588. #define REG_MULTI_SZ                ( 7 )   // Multiple Unicode strings
  1589. #define REG_RESOURCE_LIST           ( 8 )   // Resource list in the resource map
  1590. #define REG_FULL_RESOURCE_DESCRIPTOR ( 9 )  // Resource list in the hardware description
  1591. #define REG_RESOURCE_REQUIREMENTS_LIST ( 10 )
  1592.  
  1593. //
  1594. // Service Types (Bit Mask)
  1595. //
  1596. #define SERVICE_KERNEL_DRIVER          0x00000001
  1597. #define SERVICE_FILE_SYSTEM_DRIVER     0x00000002
  1598. #define SERVICE_ADAPTER                0x00000004
  1599. #define SERVICE_RECOGNIZER_DRIVER      0x00000008
  1600.  
  1601. #define SERVICE_DRIVER                 (bitor(bitor(SERVICE_KERNEL_DRIVER, SERVICE_FILE_SYSTEM_DRIVER), SERVICE_RECOGNIZER_DRIVER))
  1602.  
  1603. #define SERVICE_WIN32_OWN_PROCESS      0x00000010
  1604. #define SERVICE_WIN32_SHARE_PROCESS    0x00000020
  1605. #define SERVICE_WIN32                  (bitor(SERVICE_WIN32_OWN_PROCESS, SERVICE_WIN32_SHARE_PROCESS))
  1606.  
  1607. #define SERVICE_INTERACTIVE_PROCESS    0x00000100
  1608.  
  1609. #define SERVICE_TYPE_ALL               (bitor(bitor(bitor(SERVICE_WIN32, SERVICE_ADAPTER), SERVICE_DRIVER), SERVICE_INTERACTIVE_PROCESS))
  1610.  
  1611. //
  1612. // Start Type
  1613. //
  1614.  
  1615. #define SERVICE_BOOT_START             0x00000000
  1616. #define SERVICE_SYSTEM_START           0x00000001
  1617. #define SERVICE_AUTO_START             0x00000002
  1618. #define SERVICE_DEMAND_START           0x00000003
  1619. #define SERVICE_DISABLED               0x00000004
  1620.  
  1621. //
  1622. // Error control type
  1623. //
  1624. #define SERVICE_ERROR_IGNORE           0x00000000
  1625. #define SERVICE_ERROR_NORMAL           0x00000001
  1626. #define SERVICE_ERROR_SEVERE           0x00000002
  1627. #define SERVICE_ERROR_CRITICAL         0x00000003
  1628.  
  1629.  
  1630. //
  1631. // IOCTL_TAPE_ERASE definitions
  1632. //
  1633.  
  1634. #define TAPE_ERASE_SHORT            0
  1635. #define TAPE_ERASE_LONG             1
  1636.  
  1637.  
  1638. //
  1639. // IOCTL_TAPE_PREPARE definitions
  1640. //
  1641.  
  1642. #define TAPE_LOAD                   0
  1643. #define TAPE_UNLOAD                 1
  1644. #define TAPE_TENSION                2
  1645. #define TAPE_LOCK                   3
  1646. #define TAPE_UNLOCK                 4
  1647. #define TAPE_FORMAT                 5
  1648.  
  1649. //
  1650. // IOCTL_TAPE_WRITE_MARKS definitions
  1651. //
  1652.  
  1653. #define TAPE_SETMARKS               0
  1654. #define TAPE_FILEMARKS              1
  1655. #define TAPE_SHORT_FILEMARKS        2
  1656. #define TAPE_LONG_FILEMARKS         3
  1657.  
  1658. //
  1659. // IOCTL_TAPE_GET_POSITION definitions
  1660. //
  1661.  
  1662. #define TAPE_ABSOLUTE_POSITION       0
  1663. #define TAPE_LOGICAL_POSITION        1
  1664. #define TAPE_PSEUDO_LOGICAL_POSITION 2
  1665.  
  1666. //
  1667. // IOCTL_TAPE_SET_POSITION definitions
  1668. //
  1669.  
  1670. #define TAPE_REWIND                 0
  1671. #define TAPE_ABSOLUTE_BLOCK         1
  1672. #define TAPE_LOGICAL_BLOCK          2
  1673. #define TAPE_PSEUDO_LOGICAL_BLOCK   3
  1674. #define TAPE_SPACE_END_OF_DATA      4
  1675. #define TAPE_SPACE_RELATIVE_BLOCKS  5
  1676. #define TAPE_SPACE_FILEMARKS        6
  1677. #define TAPE_SPACE_SEQUENTIAL_FMKS  7
  1678. #define TAPE_SPACE_SETMARKS         8
  1679. #define TAPE_SPACE_SEQUENTIAL_SMKS  9
  1680.  
  1681. //
  1682. // IOCTL_TAPE_GET_DRIVE_PARAMS definitions
  1683. //
  1684.  
  1685. //
  1686. // Definitions for FeaturesLow parameter
  1687. //
  1688.  
  1689. #define TAPE_DRIVE_FIXED            0x00000001
  1690. #define TAPE_DRIVE_SELECT           0x00000002
  1691. #define TAPE_DRIVE_INITIATOR        0x00000004
  1692.  
  1693. #define TAPE_DRIVE_ERASE_SHORT      0x00000010
  1694. #define TAPE_DRIVE_ERASE_LONG       0x00000020
  1695. #define TAPE_DRIVE_ERASE_BOP_ONLY   0x00000040
  1696. #define TAPE_DRIVE_ERASE_IMMEDIATE  0x00000080
  1697.  
  1698. #define TAPE_DRIVE_TAPE_CAPACITY    0x00000100
  1699. #define TAPE_DRIVE_TAPE_REMAINING   0x00000200
  1700. #define TAPE_DRIVE_FIXED_BLOCK      0x00000400
  1701. #define TAPE_DRIVE_VARIABLE_BLOCK   0x00000800
  1702.  
  1703. #define TAPE_DRIVE_WRITE_PROTECT    0x00001000
  1704. #define TAPE_DRIVE_EOT_WZ_SIZE      0x00002000
  1705.  
  1706. #define TAPE_DRIVE_ECC              0x00010000
  1707. #define TAPE_DRIVE_COMPRESSION      0x00020000
  1708. #define TAPE_DRIVE_PADDING          0x00040000
  1709. #define TAPE_DRIVE_REPORT_SMKS      0x00080000
  1710.  
  1711. #define TAPE_DRIVE_GET_ABSOLUTE_BLK 0x00100000
  1712. #define TAPE_DRIVE_GET_LOGICAL_BLK  0x00200000
  1713. #define TAPE_DRIVE_SET_EOT_WZ_SIZE  0x00400000
  1714.  
  1715. #define TAPE_DRIVE_RESERVED_BIT     0x80000000  // don't use this bit!
  1716.                                                 // can't be a low features bit!
  1717.                                                 // reserved; high features only
  1718.  
  1719. //
  1720. // Definitions for FeaturesHigh parameter
  1721. //
  1722.  
  1723. #define TAPE_DRIVE_LOAD_UNLOAD      0x80000001
  1724. #define TAPE_DRIVE_TENSION          0x80000002
  1725. #define TAPE_DRIVE_LOCK_UNLOCK      0x80000004
  1726. #define TAPE_DRIVE_REWIND_IMMEDIATE 0x80000008
  1727.  
  1728. #define TAPE_DRIVE_SET_BLOCK_SIZE   0x80000010
  1729. #define TAPE_DRIVE_LOAD_UNLD_IMMED  0x80000020
  1730. #define TAPE_DRIVE_TENSION_IMMED    0x80000040
  1731. #define TAPE_DRIVE_LOCK_UNLK_IMMED  0x80000080
  1732.  
  1733. #define TAPE_DRIVE_SET_ECC          0x80000100
  1734. #define TAPE_DRIVE_SET_COMPRESSION  0x80000200
  1735. #define TAPE_DRIVE_SET_PADDING      0x80000400
  1736. #define TAPE_DRIVE_SET_REPORT_SMKS  0x80000800
  1737.  
  1738. #define TAPE_DRIVE_ABSOLUTE_BLK     0x80001000
  1739. #define TAPE_DRIVE_ABS_BLK_IMMED    0x80002000
  1740. #define TAPE_DRIVE_LOGICAL_BLK      0x80004000
  1741. #define TAPE_DRIVE_LOG_BLK_IMMED    0x80008000
  1742.  
  1743. #define TAPE_DRIVE_END_OF_DATA      0x80010000
  1744. #define TAPE_DRIVE_RELATIVE_BLKS    0x80020000
  1745. #define TAPE_DRIVE_FILEMARKS        0x80040000
  1746. #define TAPE_DRIVE_SEQUENTIAL_FMKS  0x80080000
  1747.  
  1748. #define TAPE_DRIVE_SETMARKS         0x80100000
  1749. #define TAPE_DRIVE_SEQUENTIAL_SMKS  0x80200000
  1750. #define TAPE_DRIVE_REVERSE_POSITION 0x80400000
  1751. #define TAPE_DRIVE_SPACE_IMMEDIATE  0x80800000
  1752.  
  1753. #define TAPE_DRIVE_WRITE_SETMARKS   0x81000000
  1754. #define TAPE_DRIVE_WRITE_FILEMARKS  0x82000000
  1755. #define TAPE_DRIVE_WRITE_SHORT_FMKS 0x84000000
  1756. #define TAPE_DRIVE_WRITE_LONG_FMKS  0x88000000
  1757.  
  1758. #define TAPE_DRIVE_WRITE_MARK_IMMED 0x90000000
  1759. #define TAPE_DRIVE_FORMAT           0xA0000000
  1760. #define TAPE_DRIVE_FORMAT_IMMEDIATE 0xC0000000
  1761. #define TAPE_DRIVE_HIGH_FEATURES    0x80000000  //mask for high features flag
  1762.  
  1763. //
  1764. // IOCTL_TAPE_CREATE_PARTITION definitions
  1765. //
  1766.  
  1767. #define TAPE_FIXED_PARTITIONS       0
  1768. #define TAPE_SELECT_PARTITIONS      1
  1769. #define TAPE_INITIATOR_PARTITIONS   2
  1770. // end winnt.h
  1771.  
  1772. //
  1773. // BUILD Version: 0001
  1774. //
  1775. //
  1776. // Module Name:
  1777. //
  1778. //  Adapted from winreg.h
  1779. //
  1780. // Abstract:
  1781. //
  1782. //    This module contains the function prototypes and constant, type and
  1783. //    structure definitions for the Windows 32-Bit Registry API.
  1784. //
  1785.  
  1786.  
  1787. //
  1788. // Requested Key access mask type.
  1789. //
  1790. #define REGSAM  ACCESS_MASK
  1791.  
  1792. //
  1793. // Type definitions.
  1794. //
  1795. #define HKEY    HANDLE
  1796. #define PHKEY   LPHANDLE
  1797.  
  1798. //
  1799. // Reserved Key Handles.
  1800. //
  1801.  
  1802. #define HKEY_CLASSES_ROOT           ( 0x80000000 )
  1803. #define HKEY_CURRENT_USER           ( 0x80000001 )
  1804. #define HKEY_LOCAL_MACHINE          ( 0x80000002 )
  1805. #define HKEY_USERS                  ( 0x80000003 )
  1806. #define HKEY_PERFORMANCE_DATA       ( 0x80000004 )
  1807. #define HKEY_CURRENT_CONFIG         ( 0x80000005 )
  1808. #define HKEY_DYN_DATA               ( 0x80000006 )
  1809.  
  1810. #define PROVIDER_KEEPS_VALUE_LENGTH 0x1
  1811. #define WIN31_CLASS                 0
  1812. // End winreg.h
  1813.  
  1814. #endif  // WINNT_H
  1815.